package cn.jdx.controller;

import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.RequestMapping;

import java.util.Arrays;

@Controller
public class MyController {
    @RequestMapping("/")
    public String test(Model model){
        //(1).普通信息
        model.addAttribute("msg","获得msg信息");
        //(2).取出标签
        model.addAttribute("tag","<h4>我是h4标签</h4>");
        //(3).遍历列表
        String names[] = {"张三","李四","王五"};
        model.addAttribute("names", Arrays.asList(names));
        return "index";
    }

}
